﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace cwdz
{
    public partial class showhead : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DateTime getNow = DateTime.Now;
            DateTime BgDate = new DateTime(getNow.Year, getNow.Month, 1);
            DateTime EdDate = BgDate.AddMonths(1).AddDays(-1);

            showDateLabel.Text = getNow.ToString();
            BgDateLabel.Text = BgDate.ToString("yyyy-MM-dd");
            EdDateLabel.Text = EdDate.ToString("yyyy-MM-dd");

            //Server.Transfer("showbody.aspx");

            
        }
        protected void GridView_head_SelectedIndexChanged(object sender, EventArgs e)
        {
            String billNo = GridView_head.SelectedRow.Cells[5].Text;
            Session["billNo"] = billNo;
            //String b6 = Convert.ToBase64String(5,"s");

            String OrgName = GridView_head.SelectedRow.Cells[0].Text;
            Session["OrgName"] = OrgName;
            
            String SupCode = GridView_head.SelectedRow.Cells[1].Text;
            Session["SupCode"] = SupCode;

            String SupName = GridView_head.SelectedRow.Cells[2].Text;
            Session["SupName"] = SupName;

            String HtCode = GridView_head.SelectedRow.Cells[3].Text;
            Session["HtCode"] = HtCode;

            String HtName = GridView_head.SelectedRow.Cells[4].Text;
            Session["HtName"] = HtName;
        }
        //protected void GridView_head_SelectedIndexChanging(object sender, EventArgs e)
        //{
        //    String billNo = GridView_head.SelectedRow.Cells[1].Text;
        //    Session["billNo"] = billNo;

        //    //Server.Transfer("showbody.aspx");

        //    String OrgName = GridView_head.SelectedRow.Cells[0].Text;
        //    Session["OrgName"] = "OrgName";
        //    //Response.AddHeader("OrgName", "qweqwe");
        //}
        //public void GridView_head_RowDataBound(object sender, GridViewRowEventArgs e)
        //{
        //    if (e.Row.RowType == DataControlRowType.DataRow)
        //    {
        //        String OrgName = GridView_head.SelectedRow.Cells[0].Text;
        //        Session["OrgName"] = "OrgName";
        //        Response.AddHeader("OrgName","qweqwe");
        //    }
        //}
    }
}